﻿using EA.DAO;
using EA.DTO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EA.BA
{
    public class LikeDislikeBA:ObjectBA
    {
        public Boolean InsertLikeDislike(LikeDislikeTO likeDislikeTO)
        {
            LikeDislikeDA likeBA = new LikeDislikeDA(ObjectBA.ConnectionString);
            return likeBA.InsertLike(likeDislikeTO);
        }

        public Boolean isLiked(int customerId, int productId)
        {
            LikeDislikeDA likeBA = new LikeDislikeDA(ObjectBA.ConnectionString);
            if (likeBA.GetLikeByProductIDAndCustomerId(productId, customerId).Rows.Count > 0)
            {
                return true;
            }

            return false;
        }
    }
}
